<template>
  <div class="dashboard">
    <!-- 左侧栏 -->
    <div class="left-bar">
      <el-row class="tac">
        <el-col>
          <h2 style="line-height: 2; text-align: center">控制台</h2>
          <el-menu
              :default-active="currentMenuItem"
              class="el-menu-vertical-demo"
              @select="handleClickTab">
            <el-menu-item index="1">
              <i class="el-icon-s-ticket"></i>
              <span slot="title">优惠券配置</span>
            </el-menu-item>
            <el-menu-item index="2">
              <i class="el-icon-menu"></i>
              <span slot="title">灰度发布</span>
            </el-menu-item>
            <el-menu-item index="3">
              <i class="el-icon-document"></i>
              <span slot="title">错误监控</span>
            </el-menu-item>
          </el-menu>
        </el-col>
      </el-row>
    </div>

    <!-- 优惠券配置 -->
    <div :hidden="currentMenuItem !== '1'" style="margin-left: 15vw">
      <CouponConfig />
    </div>

    <!-- 灰度发布 -->
    <div :hidden="currentMenuItem !== '2'" style="margin-left: 15vw">
      <GrayPublish />
    </div>

    <!-- 错误监控 -->
    <div :hidden="currentMenuItem !== '3'" style="margin-left: 15vw">
      <ErrorMonitor />
    </div>
  </div>
</template>

<script>
import CouponConfig from "@views/dashboard/component/coupon-config/index.vue";
import GrayPublish from "@views/dashboard/component/gray-publish/index.vue";
import ErrorMonitor from "@views/dashboard/component/error-monitor/index.vue";

export default {
  name: "Dashboard",
  components: {ErrorMonitor, GrayPublish, CouponConfig},
  data() {
    return {
      currentMenuItem: '1',
    }
  },
  computed: {

  },
  methods: {
    handleClickTab(index) {
      this.currentMenuItem = index;
      console.log(index)
    }
  },

  created() {

  },

  mounted() {

  }

}
</script>

<style lang="scss" scoped>
.dashboard {
  .left-bar {
    position: fixed;
    left: 0;
    top: 0;
    width: 15vw;
    height: 100vh;
    border-right: 1px solid #e6e6e6;

    .el-menu {
      border-right: none !important;
    }
  }

}
</style>
